        <div class="layui-footer">
            <!--&lt;!&ndash; 底部固定区域 &ndash;&gt;-->
            <!--2017 &copy;-->
            <!--<a href="javascript:;">Tplay后台基础框架</a> tplay.pengyichen.cn-->
        </div>
    </div>
    <script src="__PUBLIC__/layui/layui.js"></script>
    <script>
        var message;
        layui.config({
            base: '__JS__/',
            version: '1.0.1'
        }).use(['app', 'message'], function() {
            var app = layui.app,
                $ = layui.jquery,
                layer = layui.layer;
            //将message设置为全局以便子页面调用
            message = layui.message;
            //主入口
            app.set({
                type: 'iframe'
            }).init();
            
            $('dl.skin > dd').on('click', function() {
                var $that = $(this);
                var skin = $that.children('a').data('skin');
                switchSkin(skin);
            });
            var setSkin = function(value) {
                    layui.data('kit_skin', {
                        key: 'skin',
                        value: value
                    });
                },
                getSkinName = function() {
                    return layui.data('kit_skin').skin;
                },
                switchSkin = function(value) {
                    var _target = $('link[kit-skin]')[0];
                    _target.href = _target.href.substring(0, _target.href.lastIndexOf('/') + 1) + value + _target.href.substring(_target.href.lastIndexOf('.'));
                    setSkin(value);
                },
                initSkin = function() {
                    var skin = getSkinName();
                    switchSkin(skin === undefined ? 'default' : skin);
                }();
                
                $('#color').click(function(){
                layer.open({
                    type:1,
                    title:'配色方案',
                    area: ['290px', 'calc(100% - 52px)'],
                    offset: 'rb',
                    shadeClose:true,
                    id:'colors',
                    anim: 2,
                    shade:0.2,
                    closeBtn:0,
                    isOutAnim:false,
                    resize:false,
                    skin: 'color-class',
                    btn:['默认黑','橘子橙','原谅绿','少女粉','天空蓝','枫叶红'],
                    yes: function(index, layero){
                        switchSkin('default');
                      }
                      ,btn2: function(index, layero){
                        switchSkin('orange');
                        return false;
                      }
                      ,btn3: function(index, layero){
                        switchSkin('green');
                        return false;
                      }
                      ,btn4: function(index, layero){
                        switchSkin('pink');
                        return false;
                      }
                      ,btn5: function(index, layero){
                        switchSkin('blue.1');
                        return false;
                      }
                      ,btn6: function(index, layero){
                        switchSkin('red');
                        return false;
                      }

                  });
              })
        });
    </script>
    <script src="__PUBLIC__/jquery/jquery.min.js"></script>
    <script type="text/javascript">
    
        layui.use('jquery', function() {
            var $ = layui.jquery;
            $('#clear').on('click', function() {
                var the = $(this).find('i');
                the.attr("class","fa fa-spinner");
                $.ajax({
                  url:"{:url('common/clear')}"
                  ,success:function(res) {
                    if(res.code == 1) {
                        setTimeout(function(){
                            parent.message.show({
                                skin: 'cyan',
                                msg:res.msg
                            });
                            $('#clear i').attr("class","fa fa-trash");
                        },1000)
                    }
                  }
                })
            });
        });

      $('#logout').click(function(){
        layer.confirm('真的要退出?',{icon: 3, title:'提示',anim: 2}, function(index){
            $.ajax({
              url:"{:url('admin/common/logout')}"
              ,success:function(res) {
                layer.msg(res.msg,{offset: '250px',anim: 4});
                if(res.code == 1) {
                    setTimeout(function(){
                        location.href = res.url;
                    },2000)
                }
              }
            })
        }) 
      })

      $('.layui-nav-item').click(function(){
        $(this).siblings('li').attr('class','layui-nav-item');
      })

      $('#copyright').click(function(){
        layer.open({
            type:1,
            title:'版本信息',
            area: ['290px', 'calc(100% - 52px)'],
            offset: 'rb',
            shadeClose:true,
            id:'copyrights',
            anim: 2,
            shade:0.2,
            closeBtn:0,
            isOutAnim:false,
            resize:false,
            skin: 'color-class',
            content:'<p>当前版本：Tplay-v1.3</p><p>开发基于：ThinkPHP5 + Layui2</p><p>TP版本：5.0.14</p><p>Layui版本：2.2.5</p><a href="https://jq.qq.com/?_wv=1027&k=5wZeNTd" class="layui-btn layui-btn-danger" target="_blank">官方交流群</a><a href="http://tplay.pengyichen.cn" class="layui-btn" target="_blank">下载最新版</a><p>关于版权<hr></p><blockquote class="layui-elem-quote">Tplay遵循Apache2开源协议发布，并提供免费使用。请了解Apache2开源协议后再作为开源或商业软件发布。</blockquote><p>© 2018 Tplay 版权所有</p>',
          });
      })
    </script>

<script type="text/javascript">
  layui.use('layer', function(){
    var layer = layui.layer;
    var remember = '';
    
    $('#tag').click(function(){
        var tag = localStorage.getItem("tag");
      layer.prompt({
        formType: 2,
        anim: 1,
        offset: ['52px', 'calc(100% - 500px)'],
        value: tag,
        title: '便签 => 是存在本地的',
        skin: 'demo-class',
        area: ['280px', '150px'],
        id: 'remember' ,//设定一个id，防止重复弹出
        btn: ['朕写好了', '忘了吧...'],
        shade: 0,
        moveType: 1, //拖拽模式，0或者1
        btn2: function(index, layero){
            localStorage.removeItem("tag");
            $('#remember textarea').val(''); 
            return false;
          }
      },function(value, index, elem){
        localStorage.setItem("tag",value); 
      })
    });
  });              
</script>
</body>
</html>
